<?php

namespace app\controller;

use support\Http;
use support\Request;
use think\facade\Db;
use Tinywan\ExceptionHandler\Exception\BadRequestHttpException;

class IndexController
{
    protected array $noNeedLogin = ['index'];

    public function index(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        $res = (new Http())->get('https://www.baidu.com', [
            'wd' => 'aaa',
        ]);
        return json(apiSuccess([$res]));
    }
}
